#ifndef FAT_
#define FAT_
struct DirEntry
{
	unsigned char   DIR_Name[20];
	unsigned char	  DIR_Attr;			//(0B)         文件属 0.ecg 1.spo2 3.terperature
	unsigned int  	DIR_FileSize;		        //(1C-1F)   文件大小(低位在前)
	unsigned int    address;
	unsigned char zero[3];
} __attribute__ ((packed));


typedef struct dirPara
{
	int EcgFileNum;         //ecg�ļ�����
	int Spo2FileNum;
	int TemFileNum;
	int totalSize;       //当前系统所有文件大�?

}DirPara;
#define PARA_ADDR     0x00300000
struct  para_
{
	unsigned char bluetooth_flag;
	unsigned char brightness;
};
extern struct  para_ g_system_para;
#define SETTING	  0x400000
#define File_DIR          0x401000    //4M
#define File_BASE_ECG     0x404000
#define FILE_BASE_SPO2    0x800000
#define FILE_BASE_TEMP    0xB00000
void save_system_para(void);
void load_system_para(void);
void ClearAllData(void);
void CreatEcgFile(DirPara * p,int time_duration);
void savefile(void);
void delfile(char *name);
void savefiledata(unsigned char  *buf);
void findfile(char *name,char *desbuf);
void calcTotalFiles(DirPara *p);
//void CreateFile(DirPara * p);

#endif
